- Home
- LLBLGen Pro
- Bugs & Issues
LLBLGen Query Retry Loop
Joined: 06-May-2025
Greetings LLBLGen team,
We are working on updating our Oracle Managed Data Access driver to the latest 2023 version (23.8.0). In a development environment, there were not any issues in the update. However, when moving to a production environment, we get the below error. The only differences in environment is the Oracle driver. Using the old driver, our application works, but when using the new driver, we only get errors on startup. To give some context, this error is after the database factory is instantiated and is the first query made to the database.
System Warning:
License Number: -1, License ID: -1, User: , UserId: -1, EmployeeId: -1, Undetermined browser, Product Version: 1.2.162.42, DateTime: 05/06/2025 18:32:04 UTC, Handler: Global, FirstAccessingThePageLoginTimeStamp: Not Available
Warning Description: Recovery failed after 6 attempts. The first attempt failed with the following error:
The following exception occurred at System.Object OnError(Oracle.ManagedDataAccess.Client.OracleConnection, OracleInternal.ServiceObjects.CallHistoryRecord, System.Object, System.Exception, Boolean, Boolean ByRef): ORA-01013: user requested cancel of current operation https://docs.oracle.com/error-help/db/ora-01013/
Stack Trace: at OracleInternal.ServiceObjects.OracleFailoverMgrImpl.OnError(OracleConnection connection, CallHistoryRecord chr, Object mi, Exception ex, Boolean bTopLevelCall, Boolean& bCanRecordNewCall) at Oracle.ManagedDataAccess.Client.OracleDataReader.GetValues(Object[] values) at SD.LLBLGen.Pro.ORMSupportClasses.EntityMaterializerBase.Materialize(Func`4 valueReadErrorHandler, String& failureErrorText) at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterCore.ExecuteMultiRowRetrievalQuery(IRetrievalQuery queryToExecute, IEntityFactory2 entityFactory, IEntityCollection2 collectionToFill, IFieldPersistenceInfo[] fieldsPersistenceInfo, Boolean allowDuplicates, IEntityFields2 fieldsUsedForQuery) at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterCore.FetchEntityCollectionInternal(QueryParameters parameters) at SD.LLBLGen.Pro.ORMSupportClasses.PrefetchPathFetcher.FetchPrefetchPath(QueryParameters rootNodeParameters, Boolean forceParameterizedPPath, ITransaction transactionToUse, Int32 parameterisedPrefetchPathThreshold, Action`1 fetchNodeFunc, Action`4 mergeManyToManyFunc) at SD.LLBLGen.Pro.ORMSupportClasses.PersistenceCore.FetchPrefetchPath(QueryParameters rootNodeParameters, Boolean forceParameterizedPPath, ITransaction transactionToUse, Int32 parameterisedPrefetchPathThreshold, Action`1 fetchNodeFunc, Action`4 mergeManyToManyFunc) at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterCore.FetchEntityCollection(QueryParameters parameters) at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.<>c__DisplayClass10_0.<FetchEntityCollection>b__0() at SD.LLBLGen.Pro.ORMSupportClasses.RecoveryStrategyBase.<>c__DisplayClass7_0.<Execute>b__0() at SD.LLBLGen.Pro.ORMSupportClasses.RecoveryStrategyBase.Execute[TResult](Func`1 toExecute)The following exception occurred at TResult ExecuteTResult: Recovery failed: Maximum number of retries of 5 exceeded.
The following exception occurred at Grb.Platform.Framework.Business.Lower.HelperClasses.EntityCollection`1[Grb.Platform.Framework.Business.Lower.EntityClasses.DomainRootEntity] GetDomainRootEntityCollection(SD.LLBLGen.Pro.ORMSupportClasses.IDataAccessAdapter): DomainManager_GetDomainRootEntityCollection
Stack Trace:
at SD.LLBLGen.Pro.ORMSupportClasses.RecoveryStrategyBase.Execute[TResult](Func`1 toExecute) at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterCore.FetchEntityCollection(IEntityCollection2 collectionToFill, IRelationPredicateBucket filterBucket, Int32 maxNumberOfItemsToReturn, ISortExpression sortClauses, IPrefetchPath2 prefetchPath, ExcludeIncludeFieldsList excludedIncludedFields) at Grb.Platform.Framework.Business.DomainManager.GetDomainRootEntityCollection(IDataAccessAdapter externalAdapter) in C:\Source\Production\Platform\Framework\Business\DomainManager.vb:line 726 at Grb.Platform.Framework.Business.DomainManager.GetDomainRootEntityCollection(IDataAccessAdapter externalAdapter) in C:\Source\Production\Platform\Framework\Business\DomainManager.vb:line 734 at Grb.Platform.Presentation.Helper.ConfigurationValidation.ValidateAndSetConfigurationSettings() in C:\Source\Production\Platform\Presentation\Helper\ConfigurationValidation.cs:line 349 at Grb.Platform.Presentation.MvcApplication.Application_Start() in C:\Source\Production\Platform\Presentation\Global.asax.cs:line 63
When looking at the ORM profiler, the query that is being repeated is not unusual, and does work in the development environment, with the older Oracle driver, as well as with a SqlServer database. Unusually, there is no issues or alerts in the orm profiler. We believe this is an issue with llblgen as the query is executed correctly as expected but the results are not returned and instead the query is retried.
Post the LLBLGen Pro version + buildnr: 5.8.3
When it's a problem occuring at runtime, post the Runtime library version: 5.8.3
.NET version: .NET Framework 4.7.2
Database Version: Oracle Database 12c Standard Edition Release 12.1.0.2.0 - 64bit Production and Oracle.ManagedDataAccess v. 23.8.0
What has been tried: As mentioned before, we made sure that our old Oracle database driver worked, and that other databases worked without issue. We also have checked and rechecked our dependencies to make sure that everything is where it should be.
Thank you to the LLBLgen team for your time, please let me know if you need any more information.
Joined: 06-May-2025
Thank you for the response.
We don't think that this is the case for two reasons. First because of the Oracle Exception being thrown: "ORA-01013: user requested cancel of current operation." We believe this indicates that LLBLGen is cancelling the request and not Oracle refusing the connection. This is supported by the information we receive from the ORM profiler which shows a connection being made successfully, and closing after all of the retries are executed.
Additionally, I wanted to add that the driver does work when run through Visual Studio, but that the issue is when running under IIS. Also, the working version of Oracle.ManagedDataAccess we have been using is 21.10.0.
If it helps, here are the following things we had to do to get ODP 23.8.0 working locally:
First, we just changed the version of Oracle.ManagedDataAccess.dll from it's ODP 21.10.0 version (4.122.21.1) to its newest version (4.122.23.1).
The new Oracle driver makes reference to System.Threading.Tasks.Extensions (v. 4.6.3) so we had to add its .dll to our project as well as add a dependency redirect to our web.config to assembly version 4.2.4.0 (the assembly version of the above).
Likewise, we added System.Diagnostics.DiagnosticsSource (v. 9.0.4) and its .dll as well as it's dependency redirect to version 9.0.0.4.
Again, thank you for your time.
Hmm, well the exception occurs inside the Oracle.ManagedDataAccess.Client.OracleDataReader.GetValues
call, and our runtime doesn't cancel it (it doesn't cancel operations to begin with, and this stacktrace suggests it's a failure executing the query). I mentioned the transport layer because with e.g. sqlserver the same kind of error happens in that situation, but as you say if the connection is established successfully then that's not it. The next step is then to check if the user the query is ran under has the correct rights to execute the query (or access the elements participating in the query). As you mention IIS, the application will run under a less privileged user and not sure what kind of access you're using.